﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Yugi.Client;
namespace Yugi.Client.Control
{
	/// <summary>
	/// Interaction logic for ProcessState.xaml
	/// </summary>
	public partial class YProcessTurn : UserControl,IInvoke
	{
        private TurnModel model;
        public YProcessTurn()
		{
			this.InitializeComponent();
            this.DataContextChanged += new DependencyPropertyChangedEventHandler(YProcessTurn_DataContextChanged);
            Color = Brushes.Red;
            
		}

        void YProcessTurn_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            model = this.DataContext as TurnModel;
            if (model == null) return;
            model.Presenter = this;
        }


        public Brush Color { get; set; }

        #region IInvoke Members

        public void Do(ClientMSG msg, params object[] obj)
        {
            if (model.YSupervisorModel.AllowSkip)
            {
                VisualStateManager.GoToState(this,"Active_"+ obj[0].ToString(), true);
            }
            else
            {
                VisualStateManager.GoToState(this, obj[0].ToString(), true);
            }
        }
        public void Refresh()
        {
            
        }
        #endregion
    }
}